package com.tocchisu.tv.model;

import java.text.MessageFormat;


public class ProgrammationException extends Exception {

  private String message;

  public ProgrammationException(Slot schedule1, Slot schedule2) {
    Program program1 = schedule1.getProgram();
    Program program2 = schedule2.getProgram();
    this.message = MessageFormat.format("Collusion between {0} [{2}-{3}] and {1} [{4}-{5}]", program1.getDuration(), program2.getDuration(), schedule1.getStartingDate(), schedule1.getEndingDate(),
        schedule2.getStartingDate(), schedule2.getEndingDate());
  }

  @Override
  public String getMessage() {
    return this.message;
  }
}
